export enum HttpStatusCode {
  Ok = 200,
  Created = 201,
  NoContent = 204,
  BadRequest = 400,
  Unauthorized = 401,
  Forbidden = 403,
  NotFound = 404,
  InternalServerError = 500
}

export function makeResponse(ctx: any, status: HttpStatusCode): void;
export function makeResponse(
  ctx: any,
  status: HttpStatusCode,
  resultOrError: any
): void;
export function makeResponse(
  ctx: any,
  status?: HttpStatusCode,
  resultOrError?: any
) {
  status = status ?? HttpStatusCode.Ok;
  ctx.status = status;
  ctx.body = resultOrError;
}
